package Principal;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

public class leerGrafico {



public String[] leerGrafico()

{
File f;
String[] arrayDatos = null;
javax.swing.JFileChooser j= new javax.swing.JFileChooser();
j.showOpenDialog(j);
try{

String path= j.getSelectedFile().getAbsolutePath();
String l="";

f = new File(path);

try{

FileReader fr = new FileReader(f);
BufferedReader br = new BufferedReader(fr);
String aux;

while(true)
{
aux=br.readLine();
if(aux!=null){
l=l+aux+",";}
//System.out.println("Linea: "+ l);
else
	   break;
}
arrayDatos = l.split(",");

} catch(IOException e){}

return arrayDatos;

}catch(NullPointerException e){

javax.swing.JOptionPane.showMessageDialog(j, "Has seleccionado cerrar programa, saliendo...");

System.exit(0);

}return null;

}
}//fin clase